﻿@{
    ViewBag.Title = "新闻资讯";
    Layout = "../Shared/_Layout.cshtml";
}
@using mscook.mvc;
@model IEnumerable<mscook.core.domain.Bulletin>
@Html.Partial("_DeleteModal")
<div>
    <ul class="breadcrumb">
        <li>
            <a href="@Url.Action("Index", "home")">主页</a> <span class="divider">/</span>
        </li>

    </ul>
</div>

<div class="row-fluid sortable">
    <div class="box span12">
        <div class="box-header well" data-original-title="新闻列表">
            <h2><i class="icon-user"></i>新闻</h2>
            <div class="box-icon">
                <a href="@Url.Action("Add")"  class="btn btn-setting btn-round"><i class="icon-plus-sign"></i></a>
            </div>
        </div>

        <div class="box-content">
            <form class="form-horizontal" method="post" id="searchForm" action="@Url.Action("index")">
                <fieldset>
                    <div>
                        <input type="hidden" id="nowPageNum" name="nowPageNum" value="@ViewData["nowPageNum"]" />
                        <input type="hidden" id="per" name="per" value="@ViewData["per"]" />
                    </div>
                </fieldset>
            </form>
        </div>

        <div class="box-content">
            <table class="table table-striped table-bordered bootstrap-datatable ">
                <thead>
                    <tr>
                        <th>主题</th>
                        <th>摘要</th>
                        <th>发布时间</th>
                       
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var bulletin in Model)
                    {
                        var itemLength = bulletin.Summary.Length <= 15 ? bulletin.Summary.Length : 15;
                        <tr>
                            <td>@Html.Encode(bulletin.Title)</td>
                            <td class="center">@Html.Encode(bulletin.Summary.Substring(0, itemLength) + "..")</td>
                            <td class="center">@Html.Encode(bulletin.CreateTime)</td>
                            
                            <td class="center">
                                <a class="btn btn-info" href="@Url.Action("Edit", new { id = @bulletin.Id })">
                                    <i class="icon-edit icon-white"></i>
                                    Edit                                            
                                </a>
                                <a class="btn btn-danger"  href="@Url.Action("Delete", new { id = @bulletin.Id })">
                                    <i class="icon-trash icon-white"></i>
                                    Delete
                                </a>
                            </td>
                        </tr>
                    }

                </tbody>
            </table>
            @Html.Partial("_PageBreak");

        </div>
    </div>
